package com.fwtai.api.controller;

import com.fwtai.config.ConfigFile;
import com.fwtai.service.api.ApiCarouselService;
import com.fwtai.tool.ToolClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * 轮播图
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2021年8月5日 17:04:30
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Api(tags = "轮播图",description = "token选填")
@RestController
@RequestMapping(ConfigFile.guest_v10 + "carousel")
public class CarouselController{

  @Resource
  private ApiCarouselService apiCarouselService;

  @ApiOperation(value = "获取轮播图片或轮播视频,token不填", notes = "首页-获取轮播图片或轮播视频；轮播分类（1是图片轮播，2视频轮播）")
  @GetMapping("/getListImage")
  public void getListImage(final HttpServletResponse response){
    ToolClient.responseJson(apiCarouselService.getListImage(),response);
  }

  @ApiOperation(value = "获取轮播广告,token不填", notes = "首页-获取轮播图轮播图")
  @GetMapping("/getAdData")
  public void getAdData(final HttpServletResponse response){
    ToolClient.responseJson(apiCarouselService.getAdData(),response);
  }
}